<script setup>

import {ref} from "vue";
import {loginUser, ServerHost} from "@/main";
import logo from "@/assets/images/logo.svg";
import vueQr from 'vue-qr/src/packages/vue-qr.vue'


console.log("Footer.vue")
const apkUrl = ref(`${ServerHost}/getFile?path=apk&name=RRS-0.1-release-arm64-v8a.apk`)
// updateUserInfo()

</script>

<template>
  <div class="flex items-center justify-between container p-3">
    <p class="text">@乡兴助农 2025</p>
    <div>
      <el-popover
          placement="top-start"
      >
        <template #default>
          <vue-qr
              :text="apkUrl"
              :logoSrc="logo"
              colorDark="#33B173"/>
        </template>
        <template #reference>
          <el-button>下载APP</el-button>
        </template>
      </el-popover>
      <el-popover
          placement="top-start"
      >
        <template #default>
          <p>TEL：10086</p>
        </template>
        <template #reference>
          <el-button>联系我们</el-button>
        </template>
      </el-popover>
      <RouterLink class="ml-3" to="/manage" target="_blank">
        <el-button
            v-if="loginUser != null && (loginUser.username === 'rrsRoot' || loginUser.isAdmin) ">
          管理面板
        </el-button>
      </RouterLink>


    </div>
  </div>

</template>

<style scoped lang="scss">
.container {
  max-width: calc(100vw);
  height: 60px;
  background-color: var(--el-bg-color-page);
}

.text {
  font-family: "思源宋体 Heavy", serif;
  color: var(--el-color-primary);
}
</style>
